.vditor {
  &-reset {
    &--anchor {
      padding-left: 20px;
    }

    font-variant-ligatures: no-common-ligatures;
    font-family: $font-family-base;
    word-wrap: break-word;
    overflow: auto;
    line-height: 1.5;
    font-size: 16px;
    word-break: break-word;

    ul ul ul {
      list-style-type: square;
    }

    ul ul {
      list-style-type: circle;
    }

    ul {
      list-style-type: disc;
    }

    ul,
    ol {
      padding-left: 2em;
      margin-top: 0;
      margin-bottom: 16px;
    }

    li + li {
      margin-top: 0.25em;
    }

    audio {
      max-width: 100%;

      &:focus {
        outline: none;
      }
    }

    video {
      max-height: 90vh;
      max-width: 100%;
    }

    img {
      max-width: 100%;
    }

    img.emoji {
      cursor: auto;
      max-width: 20px;
      vertical-align: sub;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      margin-top: 24px;
      margin-bottom: 16px;
      font-weight: 600;
      line-height: 1.25;

      &:hover .vditor-anchor svg {
        visibility: visible;
      }
    }

    h1 {
      padding-bottom: 0.3em;
      font-size: 1.7em;
      border-bottom: 1px solid #eee;
    }

    h2 {
      padding-bottom: 0.3em;
      font-size: 1.5em;
      border-bottom: 1px solid #eee;
    }

    h3 {
      font-size: 1.25em;
    }

    h4 {
      font-size: 1em
    }

    h5 {
      font-size: 0.875em;
    }

    h6 {
      font-size: 0.85em;
    }

    hr {
      height: 2px;
      padding: 0;
      margin: 24px 0;
      background-color: #e7e7e7;
      border: 0;
    }

    p {
      margin-top: 0;
      margin-bottom: 16px;
    }

    blockquote {
      padding: 0 1em;
      color: #777;
      border-left: 0.25em solid #ddd;
      margin: 0 0 16px 0;

      p {
        margin: 0;
      }
    }

    ins > iframe {
      border: 0;
    }

    iframe {
      border: 1px solid $borderColor;
      max-width: 100%;
      box-sizing: border-box;

      &.iframe__video {
        min-width: 80%;
        min-height: 36vh;
      }
    }

    table {
      width: 100%;
      border-collapse: collapse;
      empty-cells: show;
      margin-bottom: 16px;
      display: block;
      overflow: auto;
      border-spacing: 0;

      tr {
        background-color: #fff;
        border-top: 1px solid #c6cbd1
      }

      td,
      th {
        padding: 6px 13px;
        border: 1px solid #dfe2e5;
        word-break: normal;
      }

      th {
        font-weight: 600;
      }

      tbody tr:nth-child(2n) {
        background-color: #f6f8fa;
      }
    }

    code:not(.hljs):not(.highlight-chroma) {
      padding: 0.2em 0.4em;
      margin: 0;
      font-size: 85%;
      border-radius: 3px;
      font-family: $font-family-code;
      word-break: break-word;
      background-size: 20px 20px;
      white-space: pre-wrap;
      background-color: rgba(27, 31, 35, .05);
    }

    pre > code {
      margin: 0;
      font-size: 85%;
      padding: 0.5em;
      border-radius: 5px;
      display: block;
      overflow: auto;
      white-space: pre;
      font-family: $font-family-code;
      background-size: 20px 20px;
      background-image: url();
      word-break: initial;
      word-wrap: normal;
    }

    pre:hover div.vditor-copy {
      display: block;
    }

    kbd {
      display: inline-block;
      padding: 3px 5px;
      font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
      line-height: 10px;
      color: #555;
      vertical-align: middle;
      background-color: #fcfcfc;
      border: solid 1px $borderColor;
      border-bottom-color: #bbb;
      border-radius: 3px;
      box-shadow: inset 0 -1px 0 #bbb;
    }

    summary {
      cursor: pointer;

      &:focus {
        outline: none;
      }
    }

    svg {
      height: auto;
      width: auto;
    }

    p:last-child,
    blockquote:last-child,
    pre:last-child,
    ul:last-child,
    ol:last-child,
    hr:last-child {
      margin-bottom: 0;
    }

    .language-echarts {
      overflow: hidden;
      height: 420px;
    }
  }

  &-task {
    list-style: none;

    input {
      margin: 0 .2em .25em -1.6em;
      vertical-align: middle;
    }
  }

  &-copy {
    position: relative;
    display: none;
    z-index: 1;

    textarea {
      position: absolute;
      left: -100000px;
      height: 10px;
    }

    span {
      cursor: pointer;
      position: absolute;
      right: 0.5em;
      top: 0.5em;
      height: 14px;
      width: 14px;
      display: block;
      background-color: $toolbarBg;
      border-radius: 3px;
      padding: 3px;
    }

    svg {
      color: $toolbarIcon;
      height: 14px;
      width: 14px !important;
      display: block;
      fill: currentColor;
    }
  }

  &-linenumber {
    padding-left: 4em !important;
    position: relative;

    &__rows {
      position: absolute;
      pointer-events: none;
      top: 0.5em;
      left: 0;
      width: 3em; /* works for line-numbers below 1000 lines */
      user-select: none;
      counter-reset: linenumber;

      & > span {
        pointer-events: none;
        display: block;

        &::before {
          counter-increment: linenumber;
          content: counter(linenumber);
          color: rgba(158, 150, 150, 0.38);
          display: block;
          padding-right: 1em;
          text-align: right;
        }
      }
    }
  }

  &-speech {
    position: absolute;
    display: none;
    background-color: $toolbarBg;
    border: 1px solid $borderColor;
    border-radius: 3px;
    padding: 3px;
    cursor: pointer;
    color: $toolbarIcon;

    &:hover,
    &--current {
      color: $toolbarIconHover;
    }

    svg {
      height: 14px;
      width: 14px;
      fill: currentColor;
      display: block;
      stroke-width: 0;
      stroke: currentColor;
    }
  }

  &-anchor {
    float: left;
    padding-right: 4px;
    margin-left: -20px;

    svg {
      visibility: hidden;
    }

    &:hover {
      svg {
        visibility: visible;
      }
    }

    &:focus {
      outline: none;
    }
  }

  &--error {
    color: $errorColor;
    font-size: 12px;
    display: block;
    line-height: 16px;
  }
}
